var t = require;
var e = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = t("fsm"),
    r = t("Load"),
    a = t("buffAddHp"),
    i = t("buffDefense"),
    s = t("buffFrozen"),
    c = t("buffPoisoning"),
    l = (function () {
        function t(t, e) {
            switch (
                ((this.bombBox = t),
                (this.neardata = t.data),
                (this.data = this.bombBox.skill.buff),
                (this.manager = e),
                (this.body = this.manager.body),
                (this.index = this.data.baozhahe.indexOf(this.neardata.ID)),
                (this.time = this.data.duration),
                (this.buffType = this.data.leixing),
                this.buffType)
            ) {
                case 1:
                    n.changeState(this, c.default);
                    break;
                case 2:
                    n.changeState(this, s.default);
                    break;
                case 3:
                    n.changeState(this, i.default);
                    break;
                case 4:
                    n.changeState(this, a.default);
            }
            if ("-1" != this.data.effectResourcePath) {
                this.effect = new cc.Node();
                var o = this.effect.addComponent(sp.Skeleton);
                (this.effect.parent = this.body.node),
                    (this.effect.zIndex = this.data.EffectLayer ? 0 : -1),
                    (o.skeletonData = r.default.skeletonDatas[this.data.effectResourcePath]),
                    o.setAnimation(0, "animation", !0),
                    (o.premultipliedAlpha = !1);
            }
        }
        return (
            (t.prototype.update = function (t) {
                (this.time -= t),
                    this.time <= 0 ? (n.changeState(this, null), this.manager.remove(this)) : this.state.onUpdate(t);
            }),
            (t.prototype.destory = function () {
                this.effect && this.effect.destroy();
            }),
            t
        );
    })();
o.default = l;
